<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <title>#{productCon.currentProduct.name} Details</title>
    </h:head>
    <h:body>
        <f:view contracts="main">
            <ui:composition template="/template.xhtml">
                <ui:define name="content" id="mycontent">
                    <h:form>
                        <p:commandButton value="add new product" type='button' onclick="PF('addProduct').show();"/>
                        <p:dialog widgetVar="addProduct"  width="400" height="350" header="Add #{productCon.currentProduct.name} Item">

                            <ui:include src="/WEB-INF/dialogs/newProductItem.xhtml"/>

                        </p:dialog>

                        <p:accordionPanel id="products" var="product" value="#{productItemController.getAllItems()}" >
                            <p:tab title="Item Bar Code: #{product.code}">
                                <ui:repeat value="#{productItemController.getItemValue(product)}" var="values" >
                                    <p:outputLabel value="#{values.feature.name}"/>
                                    <p:spacer width="30"/>
                                    <p:outputLabel value="#{values.value}"/>
                                    <p:separator/>
                                </ui:repeat>
                            </p:tab>



                        </p:accordionPanel>

                    </h:form>
                </ui:define>
            </ui:composition>
        </f:view>
    </h:body>
</html>

